import QtQuick 2.0
import "../config"

Rectangle{
    id:tipsContainer
    property string tips: ""
    color: AppColor.themeMode.themeColor
    width: tipsView.contentWidth
    height: tipsView.contentHeight
    visible: false
    anchors.bottom: parent.bottom
    anchors.bottomMargin: 80
    anchors.horizontalCenter: parent.horizontalCenter
    border.width: 3
    border.color: AppColor.themeMode.primaryColor


    Behavior on visible{
        PropertyAnimation { duration: 500 }
    }

    Timer {
        id: timer
        interval: 2000 // 每1000毫秒（1秒）触发一次
        onTriggered: {
            tipsContainer.visible = false
        }
    }

    Text {
        id: tipsView
        text: tips
        wrapMode: Text.WordWrap
        color: AppColors.white
    }

    function showTips(tips){
        tipsView.text = tips;
        tipsContainer.visible = true
        timer.start()
    }
}
